#include <iostream>
#include <memory>
#include <cstdlib>

#include "TCPServer.hpp"
using namespace MyTCP_Server;
void Usage(const std::string& process_name)
{
    printf("Usage:\n\t%s port\n", process_name.c_str());
    exit(0);
}
// ./epoll_server  8080
int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
    }
    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<TCPServer> tcp = std::make_unique<TCPServer>(port);
    tcp->Init();
    tcp->Loop();
    return 0;
}